<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>labelframe manual page - Tk Built-In Commands</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">Tk Commands</a> <small>&gt;</small> labelframe</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<DL>
<DD><A HREF="labelframe.htm#M2" NAME="L865">NAME</A>
<DL><DD>labelframe &mdash; Create and manipulate 'labelframe' labelled container widgets</DD></DL>
<DD><A HREF="labelframe.htm#M3" NAME="L866">SYNOPSIS</A>
<DL>
</DL>
<DD><A HREF="labelframe.htm#M4" NAME="L867">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-padx">-padx, padX, Pad</A>
<DD><A HREF="options.htm#M-pady">-pady, padY, Pad</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-text">-text, text, Text</A>
</DL>
<DD><A HREF="labelframe.htm#M5" NAME="L868">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="labelframe.htm#M6" NAME="L869">-background, background, Background</A>
<DD><A HREF="labelframe.htm#M7" NAME="L870">-class, class, Class</A>
<DD><A HREF="labelframe.htm#M8" NAME="L871">-colormap, colormap, Colormap</A>
<DD><A HREF="labelframe.htm#M9" NAME="L872">-height, height, Height</A>
<DD><A HREF="labelframe.htm#M10" NAME="L873">-labelanchor, labelAnchor, LabelAnchor</A>
<DD><A HREF="labelframe.htm#M11" NAME="L874">-labelwidget, labelWidget, LabelWidget</A>
<DD><A HREF="labelframe.htm#M12" NAME="L875">-visual, visual, Visual</A>
<DD><A HREF="labelframe.htm#M13" NAME="L876">-width, width, Width</A>
</DL>
<DD><A HREF="labelframe.htm#M14" NAME="L877">DESCRIPTION</A>
<DD><A HREF="labelframe.htm#M15" NAME="L878">WIDGET COMMAND</A>
<DL class="widget command">
<DD><A HREF="labelframe.htm#M16" NAME="L879"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="labelframe.htm#M17" NAME="L880"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
</DL>
<DD><A HREF="labelframe.htm#M18" NAME="L881">BINDINGS</A>
<DD><A HREF="labelframe.htm#M19" NAME="L882">EXAMPLE</A>
<DD><A HREF="labelframe.htm#M20" NAME="L883">SEE ALSO</A>
<DD><A HREF="labelframe.htm#M21" NAME="L884">KEYWORDS</A>
</DL>
<H3><A NAME="M2">NAME</A></H3>
labelframe &mdash; Create and manipulate 'labelframe' labelled container widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>labelframe</B> <I>pathName</I> ?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-padx">-padx, padX, Pad</A></B>
<DT><B><A HREF="options.htm#M-pady">-pady, padY, Pad</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-text">-text, text, Text</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-background</A></B>
<DT>Database Name: <B>background</B>
<DT>Database Class: <B>Background</B>
<DD>This option is the same as the standard <B>-background</B> option
except that its value may also be specified as an empty string.
In this case, the widget will display no background or border, and
no colors will be consumed from its colormap for its background
and border.
<P><DT>Command-Line Name: <B><A NAME="M7">-class</A></B>
<DT>Database Name: <B>class</B>
<DT>Database Class: <B>Class</B>
<DD>Specifies a class for the window.
This class will be used when querying the option database for
the window's other options, and it will also be used later for
other purposes such as bindings.
The <B>-class</B> option may not be changed with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M8">-colormap</A></B>
<DT>Database Name: <B>colormap</B>
<DT>Database Class: <B>Colormap</B>
<DD>Specifies a colormap to use for the window.
The value may be either <B>new</B>, in which case a new colormap is
created for the window and its children, or the name of another
window (which must be on the same screen and have the same visual
as <I>pathName</I>), in which case the new window will use the colormap
from the specified window.
If the <B>-colormap</B> option is not specified, the new window
uses the same colormap as its parent.
This option may not be changed with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M9">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies the desired height for the window in any of the forms
acceptable to <B><A HREF="../TkLib/GetPixels.htm">Tk_GetPixels</A></B>.
If this option is less than or equal to zero then the window will
not request any size at all.
<P><DT>Command-Line Name: <B><A NAME="M10">-labelanchor</A></B>
<DT>Database Name: <B>labelAnchor</B>
<DT>Database Class: <B>LabelAnchor</B>
<DD>Specifies where to place the label. A label is only displayed if the
<B>-text</B> option is not the empty string.
Valid values for this option are (listing them clockwise)
<B>nw</B>, <B>n</B>, <B>ne</B>, <B>en</B>, <B>e</B>, <B>es</B>,
<B>se</B>, <B>s</B>,<B>sw</B>, <B>ws</B>, <B>w</B> and <B>wn</B>.
The default value is <B>nw</B>.
<P><DT>Command-Line Name: <B><A NAME="M11">-labelwidget</A></B>
<DT>Database Name: <B>labelWidget</B>
<DT>Database Class: <B>LabelWidget</B>
<DD>Specifies a widget to use as label. This overrides any <B>-text</B>
option. The widget must exist before being used as <B>-labelwidget</B>
and if it is not a descendant of this window, it will be raised
above it in the stacking order.
<P><DT>Command-Line Name: <B><A NAME="M12">-visual</A></B>
<DT>Database Name: <B>visual</B>
<DT>Database Class: <B>Visual</B>
<DD>Specifies visual information for the new window in any of the
forms accepted by <B><A HREF="../TkLib/GetVisual.htm">Tk_GetVisual</A></B>.
If this option is not specified, the new window will use the same
visual as its parent.
The <B>-visual</B> option may not be modified with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M13">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies the desired width for the window in any of the forms
acceptable to <B><A HREF="../TkLib/GetPixels.htm">Tk_GetPixels</A></B>.
If this option is less than or equal to zero then the window will
not request any size at all.
</DL>
<H3><A NAME="M14">DESCRIPTION</A></H3>
The <B>labelframe</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a labelframe widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the labelframe such as its background color
and relief.  The <B>labelframe</B> command returns the
path name of the new window.
<P>
A labelframe is a simple widget.  Its primary purpose is to act as a
spacer or container for complex window layouts.  It has the features
of a <B><A HREF="../TkCmd/frame.htm">frame</A></B> plus the ability to display a label.
<H3><A NAME="M15">WIDGET COMMAND</A></H3>
The <B>labelframe</B> command creates a new Tcl command whose
name is the same as the path name of the labelframe's window.  This
command may be used to invoke various
operations on the widget.  It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>PathName</I> is the name of the command, which is the same as
the labelframe widget's path name.  <I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command.  The following
commands are possible for frame widgets:
<P>
<DL class="widget command">
<DT><A NAME="M16"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>labelframe</B>
command.
<P><DT><A NAME="M17"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TkLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list).  If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified).  If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s);  in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>labelframe</B>
command.
<P></DL>
<H3><A NAME="M18">BINDINGS</A></H3>
When a new labelframe is created, it has no default event bindings:
labelframes are not intended to be interactive.
<H3><A NAME="M19">EXAMPLE</A></H3>
This shows how to build part of a GUI for a hamburger vendor. The
<B>labelframe</B> widgets are used to organize the available choices by
the kinds of things that the choices are being made over.
<P>
<PRE>grid [<B>labelframe</B> .burger -text &quot;Burger&quot;] &#92;
     [<B>labelframe</B> .bun    -text &quot;Bun&quot;] -sticky news
grid [<B>labelframe</B> .cheese -text &quot;Cheese Option&quot;] &#92;
     [<B>labelframe</B> .pickle -text &quot;Pickle Option&quot;] -sticky news
foreach {type name val} {
    burger Beef    beef
    burger Lamb    lamb
    burger Vegetarian beans

    bun    Plain   white
    bun    Sesame  seeds
    bun    Wholemeal brown

    cheese None    none
    cheese Cheddar cheddar
    cheese Edam    edam
    cheese Brie    brie
    cheese Gruy&#92;u00e8re gruyere
    cheese &quot;Monterey Jack&quot; jack

    pickle None    none
    pickle Gherkins gherkins
    pickle Onions  onion
    pickle Chili   chili
} {
    set w [radiobutton .$type.$val -text $name -anchor w &#92;
            -variable $type -value $val]
    pack $w -side top -fill x
}
set burger beef
set bun    white
set cheese none
set pickle none</PRE>
<H3><A NAME="M20">SEE ALSO</A></H3>
<B><A HREF="../TkCmd/frame.htm">frame</A></B>, <B><A HREF="../TkCmd/label.htm">label</A></B>, <B><A HREF="../TkCmd/ttk_labelframe.htm">ttk::labelframe</A></B>
<H3><A NAME="M21">KEYWORDS</A></H3>
<A href="../Keywords/L.htm#labelframe">labelframe</A>, <A href="../Keywords/W.htm#widget">widget</A>
<div class="copy">Copyright &copy; 1990-1994 The Regents of the University of California.
<BR>Copyright &copy; 1994-1996 Sun Microsystems, Inc.
</div>
</BODY></HTML>
